package com.wyzz.hr.pojo.base;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.*;

import com.wyzz.hr.base.BaseAction;
import com.wyzz.hr.bo.IDepartmentBO;
import com.wyzz.hr.pojo.Employee;
import com.wyzz.hr.pojo.TrInstructor;
import com.wyzz.hr.pojo.TrOrg;
import com.wyzz.hr.pojo.Trclass;
import com.wyzz.hr.pojo.Trcourse;
import com.wyzz.hr.pojo.Trcourseplan;
import com.wyzz.hr.pojo.Tremployeeplan;

public abstract class BaseTrcourseplan implements Serializable {

	public BaseTrcourseplan() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseTrcourseplan(String trcpId) {
		hashCode = 0x80000000;
		setTrcpId(trcpId);
		initialize();
	}

	public BaseTrcourseplan(String trcpId, String trcpNo,
			Employee trcpCreateBy, Trcourse trcpCourseNo,
			Employee trcpLastChangeBy, BigDecimal trcpBudgetHour,
			Date trcpStartDate, Date trcpEndDate, Integer trcpStatus,
			Date trcpCreateTime, Date trcpLastChangeTime) {
		hashCode = 0x80000000;
		setTrcpId(trcpId);
		setTrcpNo(trcpNo);
		setTrcpCreateBy(trcpCreateBy);
		setTrcpCourseNo(trcpCourseNo);
		setTrcpLastChangeBy(trcpLastChangeBy);
		setTrcpBudgetHour(trcpBudgetHour);
		setTrcpStartDate(trcpStartDate);
		setTrcpEndDate(trcpEndDate);
		setTrcpStatus(trcpStatus);
		setTrcpCreateTime(trcpCreateTime);
		setTrcpLastChangeTime(trcpLastChangeTime);
		initialize();
	}

	protected void initialize() {
	}

	public String getTrcpId() {
		return trcpId;
	}

	public void setTrcpId(String trcpId) {
		this.trcpId = trcpId;
		hashCode = 0x80000000;
	}

	public String getTrcpBudgetYear() {
		return trcpBudgetYear;
	}

	public void setTrcpBudgetYear(String trcpBudgetYear) {
		this.trcpBudgetYear = trcpBudgetYear;
	}

	public BigDecimal getTrcpBudgetFee() {
		return trcpBudgetFee;
	}

	public void setTrcpBudgetFee(BigDecimal trcpBudgetFee) {
		this.trcpBudgetFee = trcpBudgetFee;
	}

	public BigDecimal getTrcpBudgetHour() {
		return trcpBudgetHour;
	}

	public void setTrcpBudgetHour(BigDecimal trcpBudgetHour) {
		this.trcpBudgetHour = trcpBudgetHour;
	}

	public Integer getTrcpAttendeeNo() {
		return trcpAttendeeNo;
	}

	public void setTrcpAttendeeNo(Integer trcpAttendeeNo) {
		this.trcpAttendeeNo = trcpAttendeeNo;
	}

	public String getTrcpDeptLimit() {
		return trcpDeptLimit;
	}

	public void setTrcpDeptLimit(String trcpDeptLimit) {
		this.trcpDeptLimit = trcpDeptLimit;
	}

	public String getTrcpLocation() {
		return trcpLocation;
	}

	public void setTrcpLocation(String trcpLocation) {
		this.trcpLocation = trcpLocation;
	}

	public Date getTrcpStartDate() {
		return trcpStartDate;
	}

	public void setTrcpStartDate(Date trcpStartDate) {
		this.trcpStartDate = trcpStartDate;
	}

	public Date getTrcpEndDate() {
		return trcpEndDate;
	}

	public void setTrcpEndDate(Date trcpEndDate) {
		this.trcpEndDate = trcpEndDate;
	}

	public Date getTrcpEnrollStartDate() {
		return trcpEnrollStartDate;
	}

	public void setTrcpEnrollStartDate(Date trcpEnrollStartDate) {
		this.trcpEnrollStartDate = trcpEnrollStartDate;
	}

	public Date getTrcpEnrollEndDate() {
		return trcpEnrollEndDate;
	}

	public void setTrcpEnrollEndDate(Date trcpEnrollEndDate) {
		this.trcpEnrollEndDate = trcpEnrollEndDate;
	}

	public Integer getTrcpStatus() {
		return trcpStatus;
	}

	public void setTrcpStatus(Integer trcpStatus) {
		this.trcpStatus = trcpStatus;
	}

	public String getTrcpComments() {
		return trcpComments;
	}

	public void setTrcpComments(String trcpComments) {
		this.trcpComments = trcpComments;
	}

	public Date getTrcpCreateTime() {
		return trcpCreateTime;
	}

	public void setTrcpCreateTime(Date trcpCreateTime) {
		this.trcpCreateTime = trcpCreateTime;
	}

	public Date getTrcpLastChangeTime() {
		return trcpLastChangeTime;
	}

	public void setTrcpLastChangeTime(Date trcpLastChangeTime) {
		this.trcpLastChangeTime = trcpLastChangeTime;
	}

	public Employee getTrcpCreateBy() {
		return trcpCreateBy;
	}

	public void setTrcpCreateBy(Employee trcpCreateBy) {
		this.trcpCreateBy = trcpCreateBy;
	}

	public Employee getTrcpCoordinator() {
		return trcpCoordinator;
	}

	public void setTrcpCoordinator(Employee trcpCoordinator) {
		this.trcpCoordinator = trcpCoordinator;
	}

	public Trcourse getTrcpCourseNo() {
		return trcpCourseNo;
	}

	public void setTrcpCourseNo(Trcourse trcpCourseNo) {
		this.trcpCourseNo = trcpCourseNo;
	}

	public Employee getTrcpLastChangeBy() {
		return trcpLastChangeBy;
	}

	public void setTrcpLastChangeBy(Employee trcpLastChangeBy) {
		this.trcpLastChangeBy = trcpLastChangeBy;
	}

	public Set getTremployeeplans() {
		return tremployeeplans;
	}

	public void setTremployeeplans(Set tremployeeplans) {
		this.tremployeeplans = tremployeeplans;
	}

	public void addTotremployeeplans(Tremployeeplan tremployeeplan) {
		if (null == getTremployeeplans())
			setTremployeeplans(new TreeSet());
		getTremployeeplans().add(tremployeeplan);
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Trcourseplan))
			return false;
		Trcourseplan trcourseplan = (Trcourseplan) obj;
		if (null == getTrcpId() || null == trcourseplan.getTrcpId())
			return false;
		else
			return getTrcpId().equals(trcourseplan.getTrcpId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getTrcpId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getTrcpId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String getTrcpInstructorComment() {
		return trcpInstructorComment;
	}

	public void setTrcpInstructorComment(String trcpInstructorComment) {
		this.trcpInstructorComment = trcpInstructorComment;
	}

	public String getTrcpAttendanceComment() {
		return trcpAttendanceComment;
	}

	public void setTrcpAttendanceComment(String trcpAttendanceComment) {
		this.trcpAttendanceComment = trcpAttendanceComment;
	}

	public String getTrcpCertificate() {
		return trcpCertificate;
	}

	public void setTrcpCertificate(String trcpCertificate) {
		this.trcpCertificate = trcpCertificate;
	}

	public TrInstructor getTrcpTrinsId() {
		return trcpTrinsId;
	}

	public void setTrcpTrinsId(TrInstructor trcpTrinsId) {
		this.trcpTrinsId = trcpTrinsId;
	}

	public TrOrg getTrcpTroId() {
		return trcpTroId;
	}

	public void setTrcpTroId(TrOrg trcpTroId) {
		this.trcpTroId = trcpTroId;
	}

	public String toString() {
		return super.toString();
	}

	public Trclass getTrcpTrclId() {
		return trcpTrclId;
	}

	public void setTrcpTrclId(Trclass trcpTrclId) {
		this.trcpTrclId = trcpTrclId;
	}

	public BigDecimal getTrcpActualFee() {
		return trcpActualFee;
	}

	public void setTrcpActualFee(BigDecimal trcpActualFee) {
		this.trcpActualFee = trcpActualFee;
	}

	public String getTrcpNo() {
		return trcpNo;
	}

	public void setTrcpNo(String trcpNo) {
		this.trcpNo = trcpNo;
	}

	public List getDeptList() {
		IDepartmentBO departmentBO = (IDepartmentBO) BaseAction
				.getBean("departmentBO");
		if (getTrcpDeptLimit() == null) {
			deptList = new ArrayList();
		} else {
			String deptNos[] = getTrcpDeptLimit().split(", ");
			deptList = departmentBO.getDepartmentsByNos(deptNos);
		}
		return deptList;
	}

	public String getDeptNames() {
		String result = getTrcpDeptLimit();
		if (result == null)
			result = "";
		result = result.trim();
		if (!result.equals("")) {
			if (result.charAt(0) == ',')
				result = result.substring(1, result.length());
			if (!result.equals("") && result.charAt(result.length() - 1) == ',')
				result = result.substring(0, result.length() - 1);
		}
		return result;
	}

	public static String REF = "Trcourseplan";
	public static String PROP_TRCP_END_DATE = "trcpEndDate";
	public static String PROP_TRCP_LAST_CHANGE_BY = "trcpLastChangeBy";
	public static String PROP_TRCP_COMMENTS = "trcpComments";
	public static String PROP_TRCP_CREATE_BY = "trcpCreateBy";
	public static String PROP_TRCP_COURSE_NO = "trcpCourseNo";
	public static String PROP_TRCP_BUDGET_YEAR = "trcpBudgetYear";
	public static String PROP_TRCP_STATUS = "trcpStatus";
	public static String PROP_TRCP_ENROLL_START_DATE = "trcpEnrollStartDate";
	public static String PROP_TRCP_ID = "trcpId";
	public static String PROP_TRCP_NO = "trcpNo";
	public static String PROP_TRCP_START_DATE = "trcpStartDate";
	public static String PROP_TRCP_ATTENDEE_NO = "trcpAttendeeNo";
	public static String PROP_TRCP_LAST_CHANGE_TIME = "trcpLastChangeTime";
	public static String PROP_TRCP_LOCATION = "trcpLocation";
	public static String PROP_TRCP_TRINS_ID = "trcpTrinsId";
	public static String PROP_TRCP_TRCL_ID = "trcpTrclId";
	public static String PROP_TRCP_TRO_ID = "trcpTroId";
	public static String PROP_TRCP_ENROLL_END_DATE = "trcpEnrollEndDate";
	public static String PROP_TRCP_CREATE_TIME = "trcpCreateTime";
	public static String PROP_TRCP_BUDGET_FEE = "trcpBudgetFee";
	public static String PROP_TRCP_COORDINATOR = "trcpCoordinator";
	public static String PROP_TRCP_DEPT_LIMIT = "trcpDeptLimit";
	public static String PROP_TRCP_BUDGET_HOUR = "trcpBudgetHour";
	public static String PROP_TRCP_INSTRUCTOR_COMMENT = "trcpInstructorComment";
	public static String PROP_TRCP_ATTENDANCE_COMMENT = "trcpAttendanceComment";
	public static String PROP_TRCP_CERTIFICATE = "trcpCertificate";
	public static String PROP_TRCP_ACTUAL_FEE = "trcpActualFee";
	private int hashCode;
	private String trcpId;
	private String trcpNo;
	private String trcpBudgetYear;
	private BigDecimal trcpBudgetFee;
	private BigDecimal trcpBudgetHour;
	private Integer trcpAttendeeNo;
	private String trcpDeptLimit;
	private String trcpLocation;
	private Date trcpStartDate;
	private Date trcpEndDate;
	private Date trcpEnrollStartDate;
	private Date trcpEnrollEndDate;
	private Integer trcpStatus;
	private String trcpComments;
	private Date trcpCreateTime;
	private Date trcpLastChangeTime;
	private String trcpInstructorComment;
	private String trcpAttendanceComment;
	private String trcpCertificate;
	private BigDecimal trcpActualFee;
	private Employee trcpCreateBy;
	private Employee trcpCoordinator;
	private Trcourse trcpCourseNo;
	private Employee trcpLastChangeBy;
	private TrInstructor trcpTrinsId;
	private Trclass trcpTrclId;
	private TrOrg trcpTroId;
	private List deptList;
	private Set tremployeeplans;

}
